home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / pcq_incl3v1.lha / Intuition / ClassUsr.i < prev    next >
Encoding:
Text File  |  1994-06-23  |  4.3 KB  |  130 lines

  1. { ClassUsr.i }
  2.  
  3. {$I   "Include:Exec/Lists.i"}
  4. {$I   "Include:Utility/Hooks.i"}
  5. {$I   "Include:Utility/TagItem.i"}
  6. {$I   "Include:Intuition/cgHooks.i"}
  7.  
  8. {** User visible handles on objects, classes, messages **}
  9. Type
  10.  Object = Integer;
  11.  ObjectPtr = ^Object;
  12.  ClassID = ^Byte;
  13.  
  14. {
  15.  you can use this type to point to a "generic" message,
  16.  * in the object-oriented programming parlance.  Based on
  17.  * the value of 'MethodID', you dispatch to processing
  18.  * for the various message types.  The meaningful parameter
  19.  * packet structure definitions are defined below.
  20.  
  21. typedef struct
  22.     ULONG MethodID;
  23.      method-specific data follows, some examples below
  24.                *Msg; }
  25.  
  26. {
  27.  * Class id strings for Intuition classes.
  28.  * There's no real reason to use the uppercase constants
  29.  * over the lowercase strings, but this makes a good place
  30.  * to list the names of the built-in classes.
  31.  }
  32. CONST
  33.  ROOTCLASS      = "rootclass"    ;         { classusr.h   }
  34.  IMAGECLASS     = "imageclass"   ;         { imageclass.h }
  35.  FRAMEICLASS    = "frameiclass"  ;
  36.  SYSICLASS      = "sysiclass"    ;
  37.  FILLRECTCLASS  = "fillrectclass";
  38.  GADGETCLASS    = "gadgetclass"  ;         { gadgetclass.h }
  39.  PROPGCLASS     = "propgclass"   ;
  40.  STRGCLASS      = "strgclass"    ;
  41.  BUTTONGCLASS   = "buttongclass" ;
  42.  FRBUTTONCLASS  = "frbuttonclass";
  43.  GROUPGCLASS    = "groupgclass"  ;
  44.  ICCLASS        = "icclass"      ;         { icclass.h    }
  45.  MODELCLASS     = "modelclass"   ;
  46.  ITEXTICLASS    = "itexticlass"  ;
  47.  POINTERCLASS   = "pointerclass" ;         { pointerclass.h }
  48.  
  49.  
  50. { Dispatched method ID's
  51.  * NOTE: Applications should use Intuition entry points, not direct
  52.  * DoMethod() calls, for NewObject, DisposeObject, SetAttrs,
  53.  * SetGadgetAttrs, and GetAttr.
  54.  }
  55.  
  56.  OM_Dummy       = ($100);
  57.  OM_NEW         = ($101); { 'object' parameter is "true class"   }
  58.  OM_DISPOSE     = ($102); { delete self (no parameters)          }
  59.  OM_SET         = ($103); { set attributes (in tag list)         }
  60.  OM_GET         = ($104); { return single attribute value        }
  61.  OM_ADDTAIL     = ($105); { add self to a List (let root do it)  }
  62.  OM_REMOVE      = ($106); { remove self from list                }
  63.  OM_NOTIFY      = ($107); { send to self: notify dependents      }
  64.  OM_UPDATE      = ($108); { notification message from somebody   }
  65.  OM_ADDMEMBER   = ($109); { used by various classes with lists   }
  66.  OM_REMMEMBER   = ($10A); { used by various classes with lists   }
  67.  
  68. { Parameter "Messages" passed to methods       }
  69.  
  70. { OM_NEW and OM_SET    }
  71. Type
  72.    opSet = Record
  73.     MethodID            : Integer;
  74.     ops_AttrList        : TagItemPtr;   { new attributes       }
  75.     ops_GInfo           : GadgetInfoPtr; { always there for gadgets,
  76.                                          * when SetGadgetAttrs() is used,
  77.                                          * but will be NULL for OM_NEW
  78.                                          }
  79.    END;
  80.    opSetPtr = ^opSet;
  81.  
  82. { OM_NOTIFY, and OM_UPDATE     }
  83.   opUpdate = Record
  84.     MethodID            : Integer;
  85.     opu_AttrList        : TagItemPtr;   { new attributes       }
  86.     opu_GInfo           : GadgetInfoPtr;  { non-NULL when SetGadgetAttrs OR
  87.                                          * notification resulting from gadget
  88.                                          * input occurs.
  89.                                          }
  90.     opu_Flags           : Integer;      { defined below        }
  91.   END;
  92.   opUpdatePtr = ^opUpdate;
  93.  
  94. { this flag means that the update message is being issued from
  95.  * something like an active gadget, a la GACT_FOLLOWMOUSE.  When
  96.  * the gadget goes inactive, it will issue a final update
  97.  * message with this bit cleared.  Examples of use are for
  98.  * GACT_FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
  99.  * for buttons.
  100.  }
  101. CONST
  102.  OPUF_INTERIM   = 1;
  103.  
  104. { OM_GET       }
  105. Type
  106.   opGet = Record
  107.     MethodID,
  108.     opg_AttrID          : Integer;
  109.     opg_Storage         : Address;   { may be other types, but "int"
  110.                                          * types are all ULONG
  111.                                          }
  112.   END;
  113.   opGetPtr = ^opGet;
  114.  
  115. { OM_ADDTAIL   }
  116.   opAddTail = Record
  117.     MethodID  : Integer;
  118.     opat_List : ListPtr;
  119.   END;
  120.   opAddTailPtr = ^opAddTail;
  121.  
  122. { OM_ADDMEMBER, OM_REMMEMBER   }
  123. Type
  124.    opMember = Record
  125.     MethodID   : Integer;
  126.     opam_Object : ObjectPtr;
  127.    END;
  128.    opMemberPtr = ^opMember;
  129.  
  130.